ImageStorage

Interface that defines the root methods required for a class/struct to be an image storage type.
Similar in purpose as InputRange is to ranges.

Must have a constructor that takes in the width and height as arguments.

this(size_t x, size_t y, IAllocator allocator = theAllocator())

Optionally may receive an allocator for allocating the pixel data from. The default is via the garbage collector.

The width and height should not be 0. Instead for dummy test code use 1.
Fields cannot be used in place of methods.

Members

Functions

getPixel
Color getPixel(size_t x, size_t y)

Get a pixel given the position.

opIndex
Color opIndex(size_t x, size_t y)

Get a pixel given the position.

opIndexAssign
void opIndexAssign(Color value, size_t x, size_t y)

Sets a pixel given the position.

resize
bool resize(size_t newWidth, size_t newHeight)

Resizes the data store.

setPixel
void setPixel(size_t x, size_t y, Color value)

Sets a pixel given the position.

Properties

height
size_t height [@property getter]

Gets the height of the image

width
size_t width [@property getter]

Gets the width of the image

Meta